home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / blackjack1.swf / scripts / frame_14 / DoAction.as
Text File  |  2006-01-17  |  3KB  |  101 lines

  1. function guessWhoDealer()
  2. {
  3.    if(Dcard0 + Dcard1 == 21)
  4.    {
  5.       if(Pcard0 + Pcard1 == 21)
  6.       {
  7.          _root.statusMov.play();
  8.          _root.statusMov.statusCopy = "You and Dealer have Blackjack! Push.";
  9.          Sponds(3);
  10.          _root.gotoAndStop("end");
  11.          return undefined;
  12.       }
  13.       if(insurance == true)
  14.       {
  15.          if(Ptotal >= 22)
  16.          {
  17.             _root.statusMov.play();
  18.             _root.statusMov.statusCopy = "Your Bust! Dealer wins.";
  19.             Sponds(1);
  20.             _root.gotoAndStop("end");
  21.             return undefined;
  22.          }
  23.          _root.statusMov.play();
  24.          _root.statusMov.statusCopy = "Dealer has Blackjack! You claim insurance.";
  25.          Sponds(3);
  26.          _root.gotoAndStop("end");
  27.          return undefined;
  28.       }
  29.       _root.statusMov.play();
  30.       _root.statusMov.statusCopy = "Dealer wins with Blackjack!";
  31.       Sponds(1);
  32.       _root.gotoAndStop("end");
  33.       return undefined;
  34.    }
  35.    if(Ptotal >= 22)
  36.    {
  37.       _root.statusMov.play();
  38.       _root.statusMov.statusCopy = "Your Bust! Dealer wins.";
  39.       Sponds(1);
  40.       _root.gotoAndStop("end");
  41.       return undefined;
  42.    }
  43.    if(Dtotal >= 22)
  44.    {
  45.       _root.statusMov.play();
  46.       _root.statusMov.statusCopy = "Dealer Busts. You win $" + currentBet[0] + ".";
  47.       Sponds(2);
  48.       _root.gotoAndStop("end");
  49.       return undefined;
  50.    }
  51.    if(Pcard0 + Pcard1 == 21)
  52.    {
  53.       Cool = Math.floor(currentBet[0] * 1.5);
  54.       _root.statusMov.play();
  55.       _root.statusMov.statusCopy = "Blackjack! You win $" + Cool + "!";
  56.       Sponds(4);
  57.       _root.gotoAndStop("end");
  58.       return undefined;
  59.    }
  60.    if(16 >= Dtotal)
  61.    {
  62.       _root.nextFrame();
  63.       return undefined;
  64.    }
  65.    if(Dtotal == Ptotal)
  66.    {
  67.       _root.statusMov.play();
  68.       _root.statusMov.statusCopy = "Your hand matches Dealers. Push.";
  69.       Sponds(3);
  70.       _root.gotoAndStop("end");
  71.       return undefined;
  72.    }
  73.    if(Ptotal < Dtotal)
  74.    {
  75.       _root.statusMov.play();
  76.       _root.statusMov.statusCopy = "Dealer wins draw with " + Dtotal + ".";
  77.       Sponds(1);
  78.       _root.gotoAndStop("end");
  79.       return undefined;
  80.    }
  81.    _root.statusMov.play();
  82.    _root.statusMov.statusCopy = "You win draw with " + Ptotal + ".";
  83.    Sponds(2);
  84.    _root.gotoAndStop("end");
  85. }
  86. function guessWhoPlayer()
  87. {
  88.    if(Pcard0 + Pcard1 == 21)
  89.    {
  90.       _root.gotoAndPlay("dealer");
  91.    }
  92.    if(Ptotal == 21)
  93.    {
  94.       _root.gotoAndPlay("dealer");
  95.    }
  96.    if(Ptotal >= 22)
  97.    {
  98.       _root.gotoAndPlay("dealer");
  99.    }
  100. }
  101.